//
//  HHKeyboardUtil.h
//  pod
//
//  Created by lzy on 15/12/26.
//  Copyright © 2015年 lzy . All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface HHKeyboardUtil : NSObject
///键盘顶部 距离，默认30
@property (nonatomic, assign) CGFloat   keyboardTopMargin;
///是否可用，默认YES
@property (nonatomic, assign) BOOL  zhenable;
///自动调整的controller，默认nil
@property (nonatomic, weak, nullable) UIViewController  *adaptiveController;
///自动调整的views，默认nil
@property (nonatomic, strong, nullable) NSArray<UIView*> *adaptiveViews;
///键盘出现block回调
@property (nonatomic, copy, nullable) void (^animateWhenKeyboardAppearBlock)(HHKeyboardUtil *keyboardUtil, int appearPostIndex, CGRect keyboardRect, CGFloat keyboardHeight, CGFloat keyboardHeightIncrement);
///键盘消失block回调
@property (nonatomic, copy, nullable) void (^animateWhenKeyboardDisappearBlock)(HHKeyboardUtil *keyboardUtil, CGFloat keyboardHeight);
///键盘出现动画block回调
@property (nonatomic, copy, nullable) void (^animateWhenKeyboardAppearAutomaticAnimBlock)(HHKeyboardUtil *keyboardUtil);

#pragma mark - public
- (void)adaptiveViewHandleWithController:(UIViewController *)viewController adaptiveView:(UIView *)adaptiveView, ...NS_REQUIRES_NIL_TERMINATION;
- (void)adaptiveViewHandleWithAdaptiveView:(UIView *)adaptiveView, ...NS_REQUIRES_NIL_TERMINATION;

/// 根据赋值的adaptiveController、adaptiveViews，重新调整view
/// @param animated 是否需要动画
-(void)readaptiveView:(BOOL )animated;

/// 调整view 列表
/// @param views view列表
- (void)adaptiveViews:(NSArray *_Nullable)views;

/// 调整某个viewController里的view列表
/// @param viewController viewController description
/// @param views views description
- (void)adaptiveVC:(UIViewController *)viewController withAdaptiveViews:(NSArray *_Nullable)views;
///自动恢复键盘
- (void)autoRestoreKeyboard;
@end


NS_ASSUME_NONNULL_END

